import request from '@/utils/request';

// 用户登录
export const userLogin = async (data: TUserApi.TLoginParams) =>
  request<TCommonResult>('/user/login', {
    method: 'POST',
    data,
  });

// 获取用户信息
export const getUserInfo = async () => request<TCommonResult>('/user/getUserInfo');

// 系统用户列表
export const queryUserList = async (
  params: {
    username?: string;
    name?: string;
  } & TPageParam,
) =>
  request<TCommonResult>('/user/list', {
    method: 'GET',
    params,
  });

// 用户登录
export const slideLogin = async (data: TUserApi.TLoginParams) =>
  request<TCommonResult>('/admin/auth/login', {
    method: 'POST',
    data,
  });
// 用户注册
export const slideRegister = async (data: TUserApi.TLoginParams) =>
  request<TCommonResult>('/admin/auth/register', {
    method: 'POST',
    data,
  });
// 读
export const getStore = async (data: TUserApi.TLoginParams) =>
  request<TCommonResult>('/store', {
    method: 'GET',
    data,
  });
// 存
export const setStore = async (data: TUserApi.TLoginParams) =>
  request<TCommonResult>('/store', {
    method: 'PUT',
    data,
  });
